package com.zwan.oam_rtc.utils.messages;

import com.zwan.oam_rtc.utils.wintcp.ByteTransfer;

import java.nio.ByteBuffer;

/***
 * 视频会议回调结果消息
 * callflowId
 * callbackUrl
 * callstatus
 * @author 
 *
 */

public class IOSRevokeMessage extends AbstractStruct {
    
//    callflowid	Varchar2(20)
//    callbackurl	Varchar2(300)
//    Callstatus	Integer

    private byte[] messageBodyHeader = new byte[8];
    private byte[] voipToken = new byte[128];
    private byte[] PhoneNumber = new byte[30];


    private static int LENGTH = 8+128+30;
    
    /**
     * 返回消息写入buffer
     */
    @Override
    public void writeToBuffer(ByteBuffer bf) {
        bf.put(messageBodyHeader);
        bf.put(voipToken);
        bf.put(PhoneNumber);
    }

    /**
     * buffer读出返回消息
     */
    @Override
    public void readFromBuffer(ByteBuffer bf) {
        bf.get(messageBodyHeader);
        bf.get(voipToken);
        bf.get(PhoneNumber);
    }

    public String getVoipToken() {
        return ByteTransfer.getString(voipToken);
    }

    public void setVoipToken(String voipToken) {
        ByteTransfer.str2Byte(voipToken, this.voipToken);
    }

    public String getPhoneNumber() {
        return ByteTransfer.getString(PhoneNumber);
    }

    public void setPhoneNumber(String PhoneNumber) {
        ByteTransfer.str2Byte(PhoneNumber, this.PhoneNumber);
    }


    @Override
    public int getLength() {
        return LENGTH;
    }



}
